package com.probox.common.entity.mapper.order;

import com.probox.common.entity.domain.order.OrderInfoItem;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.probox.order.api.domain.OrderItemVo;
import com.probox.order.api.domain.OrderQuery;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 订单明细Mapper接口
 *
 * @author hds
 * @date 2021-05-27
 */
public interface OrderInfoItemMapper extends BaseMapper<OrderInfoItem> {

    /**
     * 根据订单ID查询订单明细
     * @param orderUid
     * @return
     */
    List<OrderItemVo> getByOrderUid(Long orderUid);

    public List<OrderInfoItem> selectLuwenOrderList(OrderQuery query);

    public Integer selectLuwenOrderListCount(OrderQuery query);



    /**
     * 修改结算状态
     * @param itemIds
     * @param settlementStatus
     */
    void updateSettlement(@Param("settlementStatus") String settlementStatus, @Param("itemIds") Long [] itemIds);

    /**
     * 修改订单明细的售后状态
     * @param itemUid
     */
    void updateSaleStateToServer(Long itemUid);

    void cancelSaleState(Long itemId);

    List<Long> getByProId(OrderQuery query);

    void finishSale(Long itemUid);

    /**
     * 我的订单明细,有效已支付未售后的
     * @param customerUid
     * @return
     */
    List<OrderItemVo> getItemList(Long customerUid);

    List<OrderItemVo> getByOrderUidAndProName(OrderQuery query);

    /**
     * 余额支付信息
     * @param orderUid
     * @return
     */
    List<OrderItemVo> getOrderItem(Long orderUid);

    public Long countAmount(OrderQuery query);
}
